package hibernate.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@SuppressWarnings("serial")
@Entity
@Table(name = "dokumanlar", catalog = "emmy")
@NamedQueries({
@NamedQuery(name = "findDocAygitid", query = "from Dokumanlar where aygitid = :dAygitid"),
@NamedQuery(name = "findDocAd", 	 query = "from Dokumanlar where docAd like :dAd"),
@NamedQuery(name = "findDocKonum",   query = "from Dokumanlar where docKonum = :dKonum")
})
public class Dokumanlar implements java.io.Serializable {

	private Long docid;
	private Aygit aygit;
	private String docAd;
	private String docKonum;

	public Dokumanlar() {
	}

	public Dokumanlar(Aygit aygit, String docAd, String docKonum) {
		this.aygit = aygit;
		this.docAd = docAd;
		this.docKonum = docKonum;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "docid", unique = true, nullable = false)
	public Long getDocid() {
		return this.docid;
	}

	public void setDocid(Long docid) {
		this.docid = docid;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "aygitid", nullable = false)
	public Aygit getAygit() {
		return this.aygit;
	}

	public void setAygit(Aygit aygit) {
		this.aygit = aygit;
	}

	@Column(name = "docAd", nullable = false, length = 20)
	public String getDocAd() {
		return this.docAd;
	}

	public void setDocAd(String docAd) {
		this.docAd = docAd;
	}

	@Column(name = "docKonum", nullable = false, length = 50)
	public String getDocKonum() {
		return this.docKonum;
	}

	public void setDocKonum(String docKonum) {
		this.docKonum = docKonum;
	}
}